package com.zyl.pts.config.anno;

import com.zyl.pts.config.validated.DrStatusValidated;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @version v1.0
 * @ProjectName: product_source
 * @Package: com.zyl.pts.config.anno
 * @ClassName: DrStatus
 * @Description TODO()
 * @Author 翟玉龙
 * @Date 2024/11/22-15:04
 */
@Documented // 元注解
@Target({
        ElementType.METHOD,
        ElementType.FIELD,
        ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR,
        ElementType.PARAMETER,
        ElementType.TYPE_USE
}) // 元注解
@Retention(RetentionPolicy.RUNTIME) // 运行时生效
@Constraint(
        validatedBy = {
                DrStatusValidated.class
        } // 提供校验规则的类
)
public @interface DrStatus {
    String message() default "状态值只能是（未治疗,治疗中,已治疗）";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
